// 4 directions a tile could be facing

#pragma once

enum Facing {
	FA_N,
	FA_S,
	FA_E,
	FA_W,
};

// converts a facing into dx, dy
static void getDxAndDy(Facing f, int &dx, int &dy) {
	switch (f) {
		case FA_N:
			dx = 0; dy = -1;
			break;
		case FA_S:
			dx = 0; dy = 1;
			break;
		case FA_E:
			dx = 1; dy = 0;
			break;
		case FA_W:
			dx = -1; dy = 0;
			break;
	}
}

// flip facing 180 degrees
static Facing flip(Facing f) {
	switch (f) {
		case FA_N:
			return FA_S;
		case FA_S:
			return FA_N;
		case FA_E:
			return FA_W;
		case FA_W:
			return FA_E;
		default:
			return FA_S;
	}
}

// end of facing.h
